﻿
using System;
using System.Collections.Generic;
using System.Text;

using YouHP.Utility;
using YouHP.BLL;
using YouHP.Model;

namespace YouHP.Pages
{
    public class PatientBasePage : BasePage
    {
       
        protected override void ShowPage()
        {
            base.ShowPage();
            if(ErrorCount > 0) return;
            
            HandleCommon();
            if(ErrorCount > 0) return;
            
            if(IsPost) HandlePost();
            else HandleGet();
        }

        protected PatientRecordInfo PrData;
        protected string ErrMsg;
        protected void HandleCommon()
        {
            this.AddUserLocation();

            if (UserData.Id <= 0)
            {
                this.AddErrLine("请先登录");
                string url = this.GetUrl("/User/Login.aspx");
                ResponseHelper.Redirect(url);
                return;
            }
            PrData = PatientBLL.Instance.GetPatientRecordInfo(UserData.Id);

            if (PrData.Id <= 0)
            {
                this.AddErrLine("请先填写患病基本信息");
                TempUrl = "/DiseaseHistory/Index.aspx";
                this.SetUrl(TempUrl);
                return;
            }
           
        }
        
        protected void HandlePost()
        {
              
        }
        
        protected void HandleGet()
        {
            
		}      
    }
}